import request from '/@/utils/request'

export interface RoleForm {
  role_id?: number
  name: string
  code: string
  status: number
  remark: string
  menu_ids: number[]
}

// 获取角色列表
export function getRoleList(params: any) {
  return request({
    url: '/admin/role/getList',
    method: 'get',
    params,
  })
}

// 创建角色
export function createRole(data: RoleForm) {
  return request({
    url: '/admin/role/doAdd',
    method: 'post',
    data,
  })
}

// 更新角色
export function updateRole(data: RoleForm) {
  return request({
    url: '/admin/role/doEdit',
    method: 'post',
    data,
  })
}

// 删除角色
export function deleteRole(id: number) {
  return request({
    url: '/admin/role/doDelete',
    method: 'post',
    data: { role_id: id },
  })
} 